{extend name="template/base" /}
{block name="content"}
<div class="page-container">
    <style>
        .text-c{}
        .text-c td{border-left:none;}
        .text-c td input {width:15px;height:15px;}
        .open{position:relative;font-size:25px;}
        .open span{width:50%;height:50%;display:inline-block;border-bottom:1px #999 solid;border-left:1px #999 solid;position:absolute;right:0;top:0;}
        .open i {height:100%;width:50%;border-left:1px #999 solid;float:right;display:inline-block;position:absolute;right:0;}
        .open div{height:30%;width:50%;position:absolute;right:0;bottom:0;border-left:1px #999 solid;}
        .box{border:1px #ccc solid;width:100%;display:inline-block;}
        .delete{font-size:15px;font-weight:600;background:#eee;width:15px;height:15px;border-radius:50%;line-height:12px;cursor:pointer;position:absolute;right:-5px;top:-5px;}
        .box .title{background:#eee;padding:0 20px;line-height:30px;}
        .listBox{width:100%;margin-right:-20px;display:inline-block;}
        .listBox .list{
            font-size:14px;
            color:#020202;
            background:#f5f5f5;
            border-radius:10px;
            width:138px;
            display:inline-block;
            float:left;
            margin:20px;
            text-align:left;
            position:relative;
        }
        .listBox .list p{
            font-weight:600;
            margin:5px 0;text-align:center;
        }
        .listBox .list span{margin:5px 0;width:60px;display:inline-block;text-align:center;}
        .submits {border-top:1px #ccc solid;width:100%;background:#eee;height:40px;padding:5px 0;}
        .submits button{background:#5a98dd;font-size:15px;border-radius:5px;border:none;width:50px;height:30px;line-height:30px;color:#fff;margin:0 auto;display:block;cursor:pointer;}
        .submits button:hover{background:#0a6998;}
        .selected_box{
            background:#b7e3b7!important;
        }
    </style>
    <form class="mb-20" method="get" action="{:\\think\\Url::build($Request.action)}">
        <input type="text" class="input-text" style="width:250px" placeholder="产品ID" name="sales_id" value="{$Request.param.sales_id}">
        <input type="text" class="input-text" style="width:250px" placeholder="订单号" name="order_id" value="{$Request.param.order_id}">
        <input type="text" class="input-text" style="width:250px" placeholder="预订人" name="booking_people_name" value="{$Request.param.booking_people_name}">
        <input type="text" class="input-text" style="width:250px" placeholder="预订人电话" name="booking_people_phone" value="{$Request.param.booking_people_phone}">
        <input type="text" class="input-text" style="width:250px" placeholder="姓名" name="name" value="{$Request.param.name}">
        <input type="text" class="input-text" style="width:250px" placeholder="手机" name="phone" value="{$Request.param.phone}">
        <input type="text" class="input-text" style="width:250px" placeholder="身份证" name="id_card" value="{$Request.param.id_card}">

        <input type="text" class="input-text Wdate  mb-5" style="width:250px" placeholder="下单日期" name="ctime" value="{$Request.param.ctime}" {literal} onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})" {/literal} >
        <input type="text" class="input-text Wdate  mb-5" style="width:250px" placeholder="出行日期" name="date1" value="{$Request.param.date1}" {literal} onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})" {/literal} >
        <input type="text" class="input-text" style="width:250px" placeholder="sku_id（多个请逗号隔开）" name="sku_id" value="{$Request.param.sku_id}">
        <div class="select-box" style="width:250px">
            <select name="order_status" class="select">
                <option value="">选择订单状态</option>
                {volist name=":config('order_status')" id="order_statu"}
                <option value="{$key}">{$order_statu}</option>
                {/volist}
            </select>
        </div>
        <div class="select-box" style="width:250px">
            <select name="isrefund" class="select">
                <option value="">选择是否退款</option>
                <option value="0">不退款</option>
                <option value="1">退款</option>
            </select>
        </div>
        <div class="select-box" style="width:250px">
            <select name="platform" class="select">
                <option value="">选择平台</option>
                <option value="mfw">马蜂窝</option>
                <option value="manually">手动添加</option>
            </select>
        </div>
        <button type="submit" class="btn btn-success" id="realname_btn" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
    </form>
    <div class="cl pd-5 bg-1 bk-gray">
        <span class="l">
        </span>
        <span class="r pt-5 pr-5">
            共有数据 ：<strong>{$count ?? '0'}</strong> 条
        </span>
    </div>
    <table class="table table-border table-bordered table-hover table-bg mt-20">
        <thead>
        <tr class="text-c">
            <th width="25"><input type="checkbox"></th>
            <th width="">+</th>
            <th width="">id</th>
            <th width="">产品ID</th>
            <th width="">订单ID</th>
            <th width="">预订人</th>
            <th width="">预订人电话</th>
            <th width="">姓名</th>
            <th width="">年龄</th>
            <th width="">出发日期</th>
            <th width="">手机</th>
            <!--<th width="">身份证</th>-->
            <!--<th width="">性别</th>-->
            <!--<th width="">订单</th>-->
            <!--<th width="">住宿</th>-->
            <th width="">备注</th>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="vo"}
        <tr class="text-c">
            <td><input type="checkbox" name="id[]" value="{$vo.id}"></td>
            <td class="open">
                {if condition="$vo.show_mian"}
                <p>+</p><div></div>
                {elseif  condition="$vo.show_between" /}
                <span></span><i></i>
                {elseif  condition="$vo.show_end" /}
                <span></span>
                {/if}
            </td>
            <td>{$vo.id}</td>
            <td>{$vo.sales_id}</td>
            <td>{$vo.order_id}</td>
            <td>{$vo.booking_people_name}</td>
            <td>{$vo.booking_people_phone}</td>
            <td class="oid_{$vo.oid} traveler_{$vo.id}" data-traveler_id="{$vo.id}" data-traveler_name="{$vo.name}">{$vo.name}</td>
            <td>{$vo.age}</td>
            <td>{:date('Y-m-d',$vo.start_time)}</td>
            <td>{$vo.phone}</td>
            <!--<td>{$vo.id_card}</td>-->
            <!--<td>{$vo.sex}</td>-->
            <!--<td>{$vo.title}</td>-->
            <!--<td>{$vo.isaccommodation}{$vo.accommodation}</td>-->
            <!--<td>{$vo.remark}</td>-->


        </tr>
        {/volist}
        </tbody>
    </table>
    <div class="page-bootstrap">{$page ?? ''}</div>
    <div class="row cl">
        <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
            <button type="submit" id="submit" class="btn btn-primary radius">&nbsp;&nbsp;提交&nbsp;&nbsp;</button>
            <button type="button" class="btn btn-default radius ml-20" onClick="layer_close();">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript" src="__LIB__/template/template.js"></script>
<script>
    var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
    $(function () {

        $("[name='route_id']").find("[value='{$Request.param.route_id}']").attr("selected", true);
        $('#submit').on('click', function(){

            var getSelectValueMenbers = $("input[name='id[]']:checked").map(function(){

                return $(this).val();
            }).get().join(",");

            $.ajax({
                type : "POST", //提交方式
                url : "/admin/dispatch_traveler_group/traveler_info",//路径
                data : {
                    "id" : getSelectValueMenbers
                },//数据，这里使用的是Json格式进行传输
                //返回数据根据结果进行相应的处理
                success : function(result){
                     $.each(result.data ,function (index,item) {
                         html = template(parent.document.getElementById('td').innerHTML,item);
                         console.log(html);
                         $("#tbody",parent.document).append(html);
                     })

                    parent.layer.close(index);
                }
            });


            console.log($("#tbody",parent.document));
            // parent.$('#parentIframe').text('我被改变了');
            // parent.layer.tips('Look here', '#parentIframe', {time: 5000});

        });
    })
</script>
{/block}
